@badge-prefix-cls: ~"@{css-prefix}badge";

.@{badge-prefix-cls} {
  position: relative;
  display: inline-block;

  &-count {
    font-family: @font-family;
    vertical-align: middle;
    position: absolute;
    transform: translateX(50%);
    top: -8px;
    right: 0;
    height: 16px;
    border-radius: 8px;
    min-width: 16px;
    background: @color-functional-fail;
    border: 1px solid transparent;
    color: @color-functional-white;
    line-height: 14px;
    text-align: center;
    padding: 0 4px;
    font-size: @font-size-base;
    white-space: nowrap;
    transform-origin: -10% center;
    z-index: 10;
    // box-shadow: 0 0 0 1px @color-functional-white;

    &-subscript-three-dimensional {
      top: -60px;
      right: -24px;
      width: 92px;
      height: 147px;
      line-height: 59px;
      // background-size: 100px 200px;
      background: url()  no-repeat;
      // background: url(../images/three-dimensional.svg) no-repeat;
      // background:url(../components/images/three-dimensional.svg) no-repeat;
      transform: rotate(45deg);
      // transform:rotate(-45deg)
    }

    &-custom{
      background: transparent;
      color: inherit;
      border-color: transparent;
      box-shadow: none;
    }

    a,
    a:hover {
      color: @color-functional-white;
    }

    &-alone {
      top: auto;
      display: block;
      position: relative;
      transform: translateX(0);
      width: 34px;
    }

    &-primary{
      background: @color-brand-primary;
    }
    &-success{
      background: @color-functional-success;
    }
    &-error{
      background: @color-functional-fail;
    }
    &-warning{
      background: @color-functional-warning;
    }
    &-info{
      background: @color-functional-pause;
    }
    &-normal{
      background: @color-functional-normal;
    }
  }

  &-dot {
    position: absolute;
    transform: translateX(-50%);
    transform-origin: 0 center;
    top: -5px;
    right: -10px;
    height: 10px;
    width: 10px;
    border-radius: 100%;
    background: @color-functional-fail;
    z-index: 10;
    box-shadow: 0 0 0 1px @color-functional-white;
  }

  &-ribbon-solid {
    width: 0;
    height: 0;
    border-top: 8px solid #BF342A;
    border-right: 8px solid transparent;
    position: absolute;
    top: 21px;
    right: 0px;
    z-index: 10;
  }

  &-status {
    line-height: inherit;
    vertical-align: baseline;

    &-dot {
      width: 10px;
      height: 10px;
      display: inline-block;
      border-radius: 50%;
      vertical-align: middle;
      position: relative;
      top: -1px;
    }
    &-success {
      background-color: @color-functional-success;
    }
    &-processing {
      background-color: @color-functional-processing;
      position: relative;
      &:after {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 50%;
        border: 1px solid @color-functional-processing;
        content: '';
        animation: aniStatusProcessing 1.2s infinite ease-in-out;
      }
    }
    &-default {
      background-color: @color-functional-normal;
    }
    &-error {
      background-color: @color-functional-fail;
    }
    &-warning {
      background-color: @color-functional-warning;
    }
    &-text {
      display: inline-block;
      color: @color-text-level2;
      font-size: @font-size-base;
      margin-left: 6px;
    }
    &-ribbon-solid {
      top: 10px;
      right: 17px;
      height: 22px;
      border-radius: 4px 4px 2px 4px;
      line-height: 20px;
    }

    &-ribbon-gradient {
      top: 0px;
      right: 42px;
      width: auto;
      padding: 0 37px;
      line-height: 28px;
      height: 30px;
      border-radius: 2px;
      clip-path: polygon(0 0, 100% 0, 100% 100%, 15% 100%);
      background: linear-gradient(270deg, #FC6745 0%, #FB1A38 100%);
    }

    &-subscript-right {
      top: -21px;
      right: -33px;
      width: 60px;
      height: 20px;
      border-radius: 0;
      clip-path: polygon(19px 0, 0px 100%, 100% 100%, 68% 0);
      transform: rotate(45deg);
    }

    &-subscript-left {
      top: 30px;
      right: -33px;
      left: -5px;
      width: 60px;
      height: 20px;
      border-radius: 0;
      clip-path: polygon(19px 0, 0px 100%, 100% 100%, 68% 0);
      transform: rotate(-45deg); 
    }

    
    &-custom-bubble {
      border-radius: 2px 2px 2px 0px;
      background:  @color-functional-fail;
      width: 18px;
      height: 16px;
      &:after{
        content: '';  
        position: absolute;  
        bottom: 0;  
        left: 0px; 
        width: 3.62px;  
        height: 3px;  
        border: 4px solid transparent;  
        border-top-color:  @color-functional-fail; 
        border-bottom: 0;  
        border-left-width: 0px; 
        margin-left: -1px; 
        margin-bottom: -4px; 
      }
    }
  }
}

@keyframes aniStatusProcessing {
  0% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}
